import request from "@/utils/request";

export const getgoods = (data) => {
  return request({
    method: "GET",
    url: `/goods`,
    params: data,
  });
};
// 删除数据
export const getgoodshan = (id) => {
  return request({
    method: "DELETE",
    url: `/goods/${id}`,
    id,
  });
};
// app里获取商品分类
export const apphuo = (data) => {
  return request({
    method: "GET",
    url: `/categories`,
    params: data,
  });
};

// 获取参数列表
// categories/:id/attributes
export const apphuocan = (id, data) => {
  return request({
    method: "GET",
    url: `categories/${id}/attributes`,
    id,
    params: data,
  });
};

//添加商品
//
export const apphuotian = (data) => {
  return request({
    method: "POST",
    url: `/goods`,
    data,
  });
};
